﻿@{
    Layout = null;
    ViewBag.Title = "MyEffect";
}
<!doctype html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no,email=no,address=no" />
    <title>我的订单</title>
    <link href="~/Zhekou/dl/css/public.css" rel="stylesheet" />
    <link href="~/Zhekou/dl/css/global.css" rel="stylesheet" />
    <script src="~/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript">
        var pi = 1;
        var type = 1;
        $(function () {
            get_list();

            $('.switch_tab li').on('click', function () {
                var _this = $(this);
                if (!_this.hasClass('current')) {
                    $('.switch_tab li').removeClass('current');
                    _this.addClass('current');
                    type = _this.data('cate-id');
                    get_list();
                }
            });
        })
        function get_list(ty) {
            $.ajax({
                type: "post",
                url: "/agentcenter/GetEffect?pi=" + pi,
                data: {
                    pi: pi,
                    type: type
                },
                dataType: "json",
                success: function (data) {

                    if (data.State) {
                        var list = data.Datas;
                        var content = "";
                        for (var i = 0; i < list.length; i++) {
                            content += " <tr> ";
                            content += "<td>" + CreateDate(list[i].CreateDate) + "</td>";
                            content += "<td>" + list[i].PromotionBit + "</td>";
                            content += "<td>" + list[i].ClickNum + "</td>";
                            content += "<td>" + list[i].PayNum + "</td>";
                            content += "<td>" + list[i].Estimate + "</td>";
                            content += "<td>" + list[i].Income + "</td>";
                            content += "</tr>";
                        }
                        $('#table_list').append(content);
                        if (data.Datas.length >= 20) {
                            pi++;
                        }
                    }


                },
                error: function (data) {
                }
            })
        }
        Date.prototype.Format = function (fmt) { //author: meizz
            var o = {
                "M+": this.getMonth() + 1, //月份
                "d+": this.getDate(), //日
                "h+": this.getHours(), //小时
                "m+": this.getMinutes(), //分
                "s+": this.getSeconds(), //秒
                "q+": Math.floor((this.getMonth() + 3) / 3), //季度
                "S": this.getMilliseconds() //毫秒
            };
            if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
            for (var k in o)
                if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
            return fmt;
        }
        function CreateDate(index) {
            var birthdayMilliseconds = parseInt(index.replace(/\/Date\(/igm, ""));
            return new Date(birthdayMilliseconds).Format("MM-dd");
        }
        function getScrollTop() {
            var scrollTop = 0;
            if (document.documentElement && document.documentElement.scrollTop) {
                scrollTop = document.documentElement.scrollTop;
            }
            else if (document.body) {
                scrollTop = document.body.scrollTop;
            }
            return scrollTop;
        }
        function getClientHeight() {
            var clientHeight = 0;
            if (document.body.clientHeight && document.documentElement.clientHeight) {
                clientHeight = Math.min(document.body.clientHeight, document.documentElement.clientHeight);
            }
            else {
                clientHeight = Math.max(document.body.clientHeight, document.documentElement.clientHeight);
            }
            return clientHeight;
        }
        function getScrollHeight() {
            return Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
        }
        $(window).scroll(function () {
            if (getScrollTop() + getClientHeight() == getScrollHeight()) {
                //alert("到达底部");
                get_list(0);
            }
        });

    </script>
</head>

<body class="pageTheme">
    <div class="wrap">
        <header class="head">
            <p class="btnBack"><a href="javascript:void(0)">返回</a></p>
            <p class="tname">个人推广详情</p>
        </header>

        <div class="switch_tab">
            <ul>
                <li class="current" data-cate-id="1">本月推广</li>
                <li data-cate-id="2">上月推广</li>
                <li data-cate-id="3">所有推广</li>
            </ul>
        </div>

        <div id="nodate" style="display: none;">
            <div class="ico"></div>
            <p class="txt">亲，您还没有推广订单哦~要加油哦~</p>
        </div>
        <div class="switch_box">
            <div class="tab_content tab_content1">
                <div class="section_part">
                    <table class="table_point">
                        <thead>
                            <tr>
                                <th style="width:25%">日期</th>
                                <th style="width:25%">类型</th>
                                <th style="width:15%">点击</th>
                                <th style="width:15%">订单</th>
                                <th style="width:10%">预估</th>
                                <th style="width:10%">结算</th>
                            </tr>
                        </thead>
                        <tbody id="table_list">
                            @*@foreach (var item in Model)
                            {
                            <tr>
                                <td>@item.CreateDate.ToString("MM-dd")</td>
                                <td>@(item.PromotionBit.Contains("wx")?"微信推广":"网站推广")</td>
                                <td class="td_text">@item.ClickNum</td>
                                <td class="td_text">@item.PayNum</td>
                                <td>@item.Estimate</td>
                                <td>@item.Income</td>
                            </tr>

                            }*@


                        </tbody>
                    </table>

                </div>
            </div>
        </div>
        <div class="orderList">

        </div>

    </div>

</body>
</html>

